
<div class="tab-content">

  <div class="tab-pane fade active in" id="detail">
     <table class="table table-striped order-table">
      <tr> <th width="25%">{{'订单号'|trans}}</th> <td width="75%">{{ order.sn }}</td> </tr>
      <tr> <th width="25%">{{'订单状态'|trans}}</th>
           <td width="75%">
            {% if order.status == 'created' %} {{'未完成'|trans}}
            {% elseif order.status == 'paid' %} {{'已付款'|trans}}
            {% elseif order.status == 'cancelled' %} {{'已关闭'|trans}}
            {% elseif order.status == 'refunding' %} {{'申请退款'|trans}}
            {% elseif order.status == 'refunded' %} {{'退款成功'|trans}}
            {% endif %}
           </td>
      </tr>
      <tr>
        <th width="25%">{{'订单名称'|trans}}</th>
        <td width="75%">
          {{ order.title }}
        </td>
      </tr>
      <tr> <th width="25%">{{'购买者'|trans}}</th>
        <td width="75%">
          <strong>{{ admin_macro.user_link(user) }}</strong>
        </td>
      </tr>
      <tr> <th width="25%">{{'购买者绑定手机号'|trans}}</th>
        <td width="75%">
        {% if user.verifiedMobile == '' %}
          {{'暂无'|trans}}
        {% else %}
          {{ user.verifiedMobile }}
        {% endif %}
        </td>
      </tr>
      <tr> <th width="25%">{{'购买者邮箱'|trans}}</th>
        <td width="75%">
          {% set emailArr = user.email|split('@') %}
          {% if emailArr[1] != 'edusoho.net' %}
            {{ user.email }}
          {% else %}
            {{'暂无'|trans}}
          {% endif %}
        </td>
      </tr>
      <tr> <th width="25%">{{'订单价格'|trans}}</th>
        <td width="75%">
          <span class="money-text">{{ order.totalPrice }}</span>
          {% if order.priceType == "RMB" %}
          {{'元'|trans}}
          {% elseif order.priceType == "Coin" %}
          {{setting("coin.coin_name")}}
          {% endif %}
        </td>
      </tr>
      <tr> <th width="25%">{{'优惠码'|trans}}</th>
        <td width="75%">
          {% if order.coupon %}{{ order.coupon }}{% else %}{{'无'|trans}}{% endif %}
        </td>
      </tr>
      <tr> <th width="25%">{{'优惠金额'|trans}}</th>
        <td width="75%">
          <span class="money-text">{{ order.couponDiscount }}</span>
          {% if order.priceType == "RMB" %}
          {{'元'|trans}}
          {% elseif order.priceType == "Coin" %}
          {{setting("coin.coin_name")}}
          {% endif %}
        </td>
      </tr>
      {% if setting("coin.coin_enabled")|default(0) == 1 %}
      <tr> 
        <th width="25%">
          {% trans with {'%coin_name%': setting('coin.coin_name')|default("虚拟币"|trans)} %}%coin_name%支付{% endtrans %}
        </th>
        <td width="75%">
          <span class="money-text">{{ order.coinAmount }}</span> {{setting("coin.coin_name")}}
        </td>
      </tr>
      {% endif %}
      <tr> <th width="25%">{{'现金支付'|trans}}</th>
        <td width="75%">
          <span class="money-text">{{ order.amount }}</span> {{'元'|trans}}
        </td>
      </tr>
      <tr> <th width="25%">{{'支付方式'|trans}}</th>
           <td width="75%">
            {# {% if order.payment == 'none' %} 暂无 #}
            {{ order_payment(order) }}
           </td>
      </tr>
      <tr> <th width="25%">{{'银行编号'|trans}}</th>
           <td width="75%">
            {% if order.bank == null %} {{'暂无'|trans}}
            {% else %} {{ order.bank }}
            {% endif %}
           </td>
      </tr>
      <tr> <th width="25%">{{'创建时间'|trans}}</th> <td width="75%">{{ order.createdTime | date('Y-n-d H:i:s') }}</td> </tr>
      {% if order.status == 'paid' %}
        <tr> <th width="25%">{{'付款时间'|trans}}</th> <td width="75%">{% if not order.paidTime == 0 %} {{ order.paidTime | date('Y-n-d H:i:s') }} {% endif %}</td> </tr>
        {% if order.token %}
          <tr> <th width="25%">{{'商户订单号'|trans}}</th> <td width="75%">{{order.token}}</td> </tr>
        {% endif %}
      {% endif %}
      <tr>
        <th width="25%">{{'特殊操作'|trans}}</th>
        <td width="75%">{{ order.edit[0]|default('--') }}</td>
      </tr>
    </table>
  </div>

  <div class="tab-pane fade" id="log">
    {% if orderLogs %}
      <table class="table">
        <thead>
          <tr>
            <th width="50%">{{'日志信息'|trans}}</th>
            <th width="25%">{{'操作人'|trans}}</th>
            <th width="25%">{{'创建时间'|trans}}</th>
          </tr>
        </thead>
        <tbody>
          {% for orderLog in orderLogs %}
            {% set logUser = users[orderLog.userId]|default(null) %}
            <tr>
              <td>
                {{ orderLog.message | plain_text(50) }}
                <br>
                <span class="text-muted text-sm">{{ orderLog.type }}</span>
              </td>
              <td>
                {% if logUser %}
                  {{ admin_macro.user_link(logUser) }}
                {% else %}
                  --
                {% endif %}
              </td>
              <td>
                {{ orderLog.createdTime|date('Y-n-d H:i')}}
                <br>
                <span class="text-muted text-sm">{{ orderLog.ip}}</span>
              </td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    {% else %}
      <div class="empty">{{'暂无交易日志'|trans}}!</div>
    {% endif %}
  </div>

</div>